﻿@{
    ViewBag.Title = "我的主页";
}

<div class="jumbotron">
    @*<h1>ASP.NET</h1>
    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
    <p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>*@

    <img src="~/Content/images/home-showcase.png"/>
</div>

<ul class="row list-unstyled" id="album-list">
    @foreach (var album in Model)
    {
        <li class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
            <a href="@Url.Action("", "", new { id = album.AlbumId })">
                <img alt="@album.Title" src="@Url.Content( @album.AlbumArtUrl)" />
                <h4>@album.Title</h4>
            </a>
        </li>
    }
</ul>

<div class="panel panel-default">
    <div class="panel-heading">搜索</div>
    <div class="panel-body">
        @using (Ajax.BeginForm("Search", "Home",
                           new AjaxOptions
                           {
                               InsertionMode = InsertionMode.Replace,
                               HttpMethod = "GET",
                               OnFailure = "searchFailed",
                               LoadingElementId = "ajax-loader",
                               UpdateTargetId = "searchresults",
                           }))
        {
            <input type="text" name="s" />
            <input type="submit" value="搜索" />
            <img id="ajax-loader"
                 src="@Url.Content("~/Images/ajax-loader.gif")"
                 style="display:none" />
        }
        <div id="searchresults"></div>
    </div>
</div>


<div id="dailydeal">
    @*ActionLink第一个参数指定链接文本，第二个参数是异步调用的方法名称，第四个参数提供Ajax辅助方法重载版本*@
    @Ajax.ActionLink("戳此查看今日优惠!",
        "DailyDeal",
        null,
        new AjaxOptions
        //AjaxOptions指定用来自服务器的响应元素替换id值为dailydeal的元素
        {
            UpdateTargetId = "dailydeal",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "GET"
        },
        //指定链接按钮使用的Bootstrap样式
        new { @class = "btn btn-primary" })
</div>

@section Scripts {
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
}


<ul class="row list-unstyled" id="album-list">@* 不换行 *@
    @foreach (var album in Model)
    {
        <li>
            <a href="@Url.Action("Index", "Manages", new { id = album.AlbumId })">
            <img alt="@album.Title" src="~/Content/images/placeholder.gif" />
                <h4>@album.Title</h4>
            </a>
        </li>
        }
</ul>

@*<div class="row">
    <div class="col-md-4">
        <h2>Getting started</h2>
        <p>
            ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
            enables a clean separation of concerns and gives you full control over markup
            for enjoyable, agile development.
        </p>
        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p>
    </div>
    <div class="col-md-4">
        <h2>Get more libraries</h2>
        <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p>
    </div>
    <div class="col-md-4">
        <h2>Web Hosting</h2>
        <p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p>
    </div>
</div>*@

@*<a href="~/Views/Home/Index.cshtml">~/Views/Home/Index.cshtml</a>*@

@*<p class="btn btn-default">
   
</p>*@
    @*@Html.ActionLink("注册", "Create", "Register")*@
    @*@Html.ActionLink("登录", "Login", "Account")*@

@*@section Script{
    <script src="~/Scripts/Apps/Mouseover.js"></script>
    }*@
